---
sidebar_label: RESTified GraphQL endpoints
sidebar_position: 13
description: Manage RESTified endpoints with the Hasura schema/Metadata API
keywords:
  - hasura
  - docs
  - restified-endpoints/Metadata API
  - API reference
  - RESTified endpoints
---

# Schema/Metadata API Reference: RESTified GraphQL Endpoints (Deprecated)

:::caution Deprecation

In versions `v2.0.0` and above, the schema/Metadata API is deprecated in
favour of the [schema API](/api-reference/schema-api/index.mdx) and the
[Metadata API](/api-reference/metadata-api/index.mdx).

Though for backwards compatibility, the schema/Metadata APIs will
continue to function.

:::

## Introduction

Add/Remove a RESTified GraphQL endpoint to Hasura GraphQL Engine.

## create_rest_endpoint {#schema-metadata-create-rest-endpoint}

`create_rest_endpoint` is used to associate a URL template with a query.

An example request as follows:

```http
POST /v1/query HTTP/1.1
Content-Type: application/json
X-Hasura-Role: admin

{
    "type": "create_rest_endpoint",
    "args": {
        "name": "example-name",
        "url": "example",
        "methods": ["POST","PUT","PATCH"],
        "definition": {
            "query": {
              "query_name": "example_mutation",
              "collection_name": "test_collection"
            }
        },
        "comment": "some optional comment"
    }
}
```

### Args syntax {#schema-metadata-create-rest-endpoint-syntax}

| Key        | Required | Schema                                                            | Description                                             |
| ---------- | -------- | ----------------------------------------------------------------- | ------------------------------------------------------- |
| name       | true     | Text                                                              | A unique identifier for the endpoint                    |
| url        | true     | [EndpointUrl](/api-reference/syntax-defs.mdx#endpointurl)         | URL of the REST endpoint                                |
| methods    | true     | [EndpointMethods](/api-reference/syntax-defs.mdx#endpointmethods) | Non-Empty case sensitive list of supported HTTP Methods |
| definition | true     | [EndpointDefinition](/api-reference/syntax-defs.mdx#endpointdef)  | Definition for the REST endpoint                        |
| comment    | false    | Text                                                              | comment                                                 |

:::tip Supported from

RESTified endpoints are supported from versions `v2.0.0-alpha.1` and
above.

:::

## drop_rest_endpoint {#schema-metadata-drop-rest-endpoint}

`drop_rest_endpoint` is used to delete an existing RESTified GraphQL Endpoint.

An example request as follows:

```http
POST /v1/query HTTP/1.1
Content-Type: application/json
X-Hasura-Role: admin

{
    "type": "drop_rest_endpoint",
    "args": {
        "name": "name_of_the_endpoint"
    }
}
```

### Args syntax {#schema-metadata-drop-rest-endpoint-syntax}

| Key  | Required | Schema | Description                   |
| ---- | -------- | ------ | ----------------------------- |
| name | true     | Text   | URL of the RESTified endpoint |

:::tip Supported from

RESTified endpoints are supported from versions `v2.0.0-alpha.1` and above.

:::
